package com.zhengke.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zhengke.common.dao.CommonDao;
import com.zhengke.common.object.Result;
import com.zhengke.pojo.Spflxstj;
@Service
public class SpflxstjServiceImpl implements SpflxstjService {
	/**
     * ssx
     * */
	@Autowired
	private CommonDao dao;
	@SuppressWarnings("unchecked")
	@Override
	public Result quaryAll(String startTime,String endTime,int pageNum, int size) throws Exception {
		
		Map<String,String> param = new HashMap<String,String>();
		param.put("startTime", startTime);
		param.put("endTime", endTime);
		
		PageHelper.startPage(pageNum, size, true);
		List<Spflxstj>list = (List<Spflxstj>) dao.findForList("SpflxstjMapper.querys", param);
        PageInfo<Spflxstj> pageInfo = new PageInfo<Spflxstj>(list);
		Result rs = new Result();
		rs.setCode("0");
		rs.setCount(pageInfo.getTotal());
        rs.setData(list);		
		return rs;
	}

}
